using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class TrailReport : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
		TrailReportWebService.Report trailReport = new TrailReportWebService.Report();
		string trails = trailReport.GetTrails();
		System.Xml.XmlDataDocument xmlTrails = new System.Xml.XmlDataDocument();
		xmlTrailsSource.Data = trails;
	}
	protected void tvwTrails_SelectedNodeChanged(object sender, EventArgs e)
	{
		if (tvwTrails.SelectedNode.ChildNodes.Count == 0)
		{
			TrailReportWebService.Report report = new TrailReportWebService.Report();
			string trailName = tvwTrails.SelectedNode.Text;
			string trailWeatherReport = report.weatherReport(tvwTrails.SelectedNode.Text);
			string trailConditionReport = report.trailReport(tvwTrails.SelectedNode.Text);
			lblTrailName.Text = trailName;
			lblCondition.Text = "Condition: " + trailConditionReport;
			lblWeather.Text = "Weather: " + trailWeatherReport;

		}
		else 
		{
			tvwTrails.SelectedNode.Expand();
			lblTrailName.Text = "";
			lblCondition.Text = "";
			lblWeather.Text = "";
		}
	}
}
